package com.itheima.controller;

import com.itheima.domain.Order;
import com.itheima.po.LoginPo;
import com.itheima.po.RegisterPo;
import org.springframework.validation.Errors;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * @author itheima
 * @since 2021-10-28
 */
@RestController
@RequestMapping("order")
public class OrderController {

    @GetMapping("/user/{name}/{password}")
    public String getOrderList(@PathVariable String name, @PathVariable String password) {
        return "getOrderList";
    }

    @GetMapping("{orderId}/goods")
    public String getOrderGoods(@PathVariable String orderId) {
        return "getOrderGoods";
    }

    @PostMapping("")
    public String createOrder(@RequestBody Order order) {
        System.out.println(order);
        return "createOrder";
    }

    @DeleteMapping("{orderId}")
    public String removeOrder(@PathVariable String orderId) {
        return "removeOrder";
    }
}
